/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.facturacion.dao;

import isd.facturacion.modelo.FC_Comprobante;
import isd.general.dao.BaseDAO;
import isd.general.modelo.GR_ComprobantePK;
import java.util.List;
import java.util.Map;
import javax.ejb.Stateless;

/**
 *
 * @author Claudio
 */
@Stateless
public class FC_ComprobanteDAO extends BaseDAO {

    public FC_Comprobante getComprobante(GR_ComprobantePK idPK){

        return em.find(FC_Comprobante.class, idPK);
    }

    public void eliminar(FC_Comprobante o) throws Exception{

        super.eliminar(FC_Comprobante.class, o.getCodigo());
    }

    public List<FC_Comprobante> getLista() {
        return getLista(FC_Comprobante.class, true , -1, -1);
    }

    public List<FC_Comprobante> getLista(Map<String, String> filtro) {

        String sQuery = "SELECT i FROM PDComprobante i ";
              sQuery += generarStringFiltro(filtro,"i", true);

        return queryList(FC_Comprobante.class, sQuery);
    }



    
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
 
}
